<template>
	<view class="wrapper">
      <view class="avatar-wrapper" v-for="(item,index) in imageList">
          <image class="avatar-wrapper-item" :src='item.path'  @click="tapImage(item)"></image>
      </view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
          imageList:[]
			}
		},
      onShow() {
        this.imageList = [];
          for (let i = 0; i < 30; i++) {
              this.imageList.push({id:i,path:'/static/avatares/a'+i+'.png'});
          }
      },
		methods: {
        tapImage(item) {
            uni.setStorageSync('avatar', item.path);
            console.log('点击图片：：：',item);
        }
		}
	}
</script>

<style scoped lang="scss">
.wrapper{
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    .avatar-wrapper {
        border: 5px solid #48436C;
        width: 46%;
        height: 300rpx;
        background: #EBC08D;
        display: flex;
        align-items: center;
        justify-content: center;
        .avatar-wrapper-item {
            width: 80%;
            height: 80%;
        }
    }
}
</style>
